<?php
	include "../connect.php";
	//$strSQL = "SELECT * FROM employee WHERE 1 AND emp_id = '".$_POST["semp_id"]."' ";      
        $strSQL = "SELECT depart.*,  employee.* FROM depart LEFT JOIN employee ON depart.id = employee.de_id WHERE emp_id = '".$_POST["semp_id"]."' ";        
	$objQuery = mysql_query($strSQL) or die (mysql_error());
	$intNumField = mysql_num_fields($objQuery);
	$resultArray = array();
	while($obResult = mysql_fetch_array($objQuery))
	{
		$arrCol = array();
		for($i=0;$i<$intNumField;$i++)
		{
			$arrCol[mysql_field_name($objQuery,$i)] = $obResult[$i];
		}
		array_push($resultArray,$arrCol);
	}
	
	mysql_close($connection);
	
	echo json_encode($resultArray);
?>

